Optimal. Leaf size=69 \[ \frac {b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \cot (c+d x)}{d}-\frac {a \cot ^3(c+d x)}{3 d}-\frac {b \csc (c+d x)}{d}-\frac {b \csc ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {3957, 2917,
2701, 308, 213, 3852} \begin {gather*} -\frac {a \cot ^3(c+d x)}{3 d}-\frac {a \cot (c+d x)}{d}-\frac {b \csc ^3(c+d x)}{3 d}-\frac {b \csc (c+d x)}{d}+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 213
Rule 308
Rule 2701
Rule 2917
Rule 3852
Rule 3957
Rubi steps
\begin {align*} \int \csc ^4(c+d x) (a+b \sec (c+d x)) \, dx &=-\int (-b-a \cos (c+d x)) \csc ^4(c+d x) \sec (c+d x) \, dx\\ &=a \int \csc ^4(c+d x) \, dx+b \int \csc ^4(c+d x) \sec (c+d x) \, dx\\ &=-\frac {a \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (c+d x)\right )}{d}-\frac {b \text {Subst}\left (\int \frac {x^4}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=-\frac {a \cot (c+d x)}{d}-\frac {a \cot ^3(c+d x)}{3 d}-\frac {b \text {Subst}\left (\int \left (1+x^2+\frac {1}{-1+x^2}\right ) \, dx,x,\csc (c+d x)\right )}{d}\\ &=-\frac {a \cot (c+d x)}{d}-\frac {a \cot ^3(c+d x)}{3 d}-\frac {b \csc (c+d x)}{d}-\frac {b \csc ^3(c+d x)}{3 d}-\frac {b \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=\frac {b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \cot (c+d x)}{d}-\frac {a \cot ^3(c+d x)}{3 d}-\frac {b \csc (c+d x)}{d}-\frac {b \csc ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in
optimal.
time = 0.02, size = 69, normalized size = 1.00 \begin {gather*} -\frac {2 a \cot (c+d x)}{3 d}-\frac {a \cot (c+d x) \csc ^2(c+d x)}{3 d}-\frac {b \csc ^3(c+d x) \, _2F_1\left (-\frac {3}{2},1;-\frac {1}{2};\sin ^2(c+d x)\right )}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 63, normalized size = 0.91
method | result | size |
derivativedivides | \(\frac {b \left (-\frac {1}{3 \sin \left (d x +c \right )^{3}}-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+a \left (-\frac {2}{3}-\frac {\left (\csc ^{2}\left (d x +c \right )\right )}{3}\right ) \cot \left (d x +c \right )}{d}\) | \(63\) |
default | \(\frac {b \left (-\frac {1}{3 \sin \left (d x +c \right )^{3}}-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+a \left (-\frac {2}{3}-\frac {\left (\csc ^{2}\left (d x +c \right )\right )}{3}\right ) \cot \left (d x +c \right )}{d}\) | \(63\) |
risch | \(-\frac {2 i \left (3 b \,{\mathrm e}^{5 i \left (d x +c \right )}-10 b \,{\mathrm e}^{3 i \left (d x +c \right )}-6 a \,{\mathrm e}^{2 i \left (d x +c \right )}+3 b \,{\mathrm e}^{i \left (d x +c \right )}+2 a \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) | \(110\) |
norman | \(\frac {-\frac {a +b}{24 d}+\frac {\left (a -b \right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {\left (3 a -5 b \right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}-\frac {\left (3 a +5 b \right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(125\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 76, normalized size = 1.10 \begin {gather*} -\frac {b {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{2} + 1\right )}}{\sin \left (d x + c\right )^{3}} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {2 \, {\left (3 \, \tan \left (d x + c\right )^{2} + 1\right )} a}{\tan \left (d x + c\right )^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.79, size = 125, normalized size = 1.81 \begin {gather*} -\frac {4 \, a \cos \left (d x + c\right )^{3} + 6 \, b \cos \left (d x + c\right )^{2} - 3 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 3 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 6 \, a \cos \left (d x + c\right ) - 8 \, b}{6 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right ) \csc ^{4}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 133 vs.
\(2 (65) = 130\).
time = 0.47, size = 133, normalized size = 1.93 \begin {gather*} \frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 24 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + 9 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {9 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 15 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.00, size = 101, normalized size = 1.46 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {a}{24}-\frac {b}{24}\right )}{d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\left (3\,a+5\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {a}{3}+\frac {b}{3}\right )}{8\,d}+\frac {2\,b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,a}{8}-\frac {5\,b}{8}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________